

#  for循环中的range是前闭后开


# # 打印1-10
# for i in range(1,11):
#     print(i)


# # 打印 2、4、6、8
# for i in range(2,9,2):
#     print(i)


# #  打印10-1
# for i in range(10,0,-1):
#     print(i)

# #  计算1+2+3...100
# theSum = 0
# for i in range(1,101):
#     theSum += i
# print(f'sum = {theSum}')


#  持续输入，计算平均值
theSum = 0
account = 0
#  while True:不一定是死循环
while True:
    # 输入一个数字，以;结尾
    num = input('请输入一个数字【;结束】：')
    if(num == ';'):
        break
    num = int(num)
    theSum += num
    account += 1
print(f'平均值为：{theSum / account}')